﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WeChat.AspNet.Events
{
    public class ScanEventArgs : UserEventArgs
    {
        public ScanEventArgs(Hashtable values) : base(values)
        {
            EventKey = (string)values["EventKey"];

            Ticket = (string)values["Ticket"];

            var et = (string)values["Event"];

            Type = et.ToEnum<ScanType>();
        }
        /// <summary>
        /// 事件KEY值，是一个32位无符号整数
        /// </summary>
        public string EventKey { get; set; }
        /// <summary>
        /// 二维码的ticket，可用来换取二维码图片
        /// </summary>
        public string Ticket { get; set; }
        /// <summary>
        /// 扫描类型
        /// </summary>
        public ScanType Type { get; set; }
    }

    /// <summary>
    /// 扫描类型
    /// </summary>
    public enum ScanType
    {
        Subscribe,

        Scan
    }
}
